import { _decorator, Component, instantiate, Node, Prefab } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('ZambieController')
export class ZambieController extends Component {
    @property(Prefab)
    zambie: Prefab = null;
    @property(Node)
    zambieParent: Node = null;
    start() {
        this._init();
        
    }
    _init(){
        let _zambie = instantiate(this.zambie)
        // _zambie.setPosition(759.372, 631.989,0)
        _zambie.active = true
        
        this.zambieParent.addChild(_zambie)
        
        this.schedule(() => {
            _zambie.setPosition(this.node.position.x+0.1, this.node.position.y,0);
        }, 0.1);
    }
    update(deltaTime: number) {
        
    }
}

